package com.utonw.carloan.bean.applyloan;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by SEELE on 2017/4/1.
 */

public class LoanPlanBean implements Parcelable{


    /**
     * retCode : 000000
     * message : 查询成功
     * result : {"repayTotal":"1947.01","repayPlanList":[{"period":"0","totalMoney":"800.00","repayPlanDetailForApp":{"repayPeriod":"0","repayCapital":"0","repayInterest":"0","cashdepositFee":null,"repayTotal":"800.00","remark":"第0期还款","repayDate":"Sat Apr 01 00:00:00 CST 2017","gpsCost":"800.00","parkCost":"0","depreciationFee":"0","drunkDrive":"0"}},{"period":"1","totalMoney":"147.00","repayPlanDetailForApp":{"repayPeriod":"1","repayCapital":"0","repayInterest":"0","cashdepositFee":null,"repayTotal":"147.00","remark":"第1期还款","repayDate":"Mon May 15 00:00:00 CST 2017","gpsCost":"0","parkCost":"0","depreciationFee":"0","drunkDrive":"147"}},{"period":"2","totalMoney":"100.00","repayPlanDetailForApp":{"repayPeriod":"2","repayCapital":"0","repayInterest":"0","cashdepositFee":null,"repayTotal":"100.00","remark":"第2期还款","repayDate":"Thu Jun 15 00:00:00 CST 2017","gpsCost":"0","parkCost":"0.00","depreciationFee":"0","drunkDrive":"100.00"}},{"period":"3","totalMoney":"900.01","repayPlanDetailForApp":{"repayPeriod":"3","repayCapital":"0.01","repayInterest":"0","cashdepositFee":null,"repayTotal":"900.01","remark":"第3期还款","repayDate":"Sat Jul 15 00:00:00 CST 2017","gpsCost":"800.00","parkCost":"0","depreciationFee":"0","drunkDrive":"100"}}]}
     */

    private String retCode;
    private String message;
    private ResultBean result;

    protected LoanPlanBean(Parcel in) {
        retCode = in.readString();
        message = in.readString();
        result = in.readParcelable(ResultBean.class.getClassLoader());
    }

    public static final Creator<LoanPlanBean> CREATOR = new Creator<LoanPlanBean>() {
        @Override
        public LoanPlanBean createFromParcel(Parcel in) {
            return new LoanPlanBean(in);
        }

        @Override
        public LoanPlanBean[] newArray(int size) {
            return new LoanPlanBean[size];
        }
    };

    public String getRetCode() {
        return retCode;
    }

    public void setRetCode(String retCode) {
        this.retCode = retCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public ResultBean getResult() {
        return result;
    }

    public void setResult(ResultBean result) {
        this.result = result;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(retCode);
        dest.writeString(message);
        dest.writeParcelable(result, flags);
    }

    public static class ResultBean implements Parcelable{
        /**
         * repayTotal : 1947.01
         * repayPlanList : [{"period":"0","totalMoney":"800.00","repayPlanDetailForApp":{"repayPeriod":"0","repayCapital":"0","repayInterest":"0","cashdepositFee":null,"repayTotal":"800.00","remark":"第0期还款","repayDate":"Sat Apr 01 00:00:00 CST 2017","gpsCost":"800.00","parkCost":"0","depreciationFee":"0","drunkDrive":"0"}},{"period":"1","totalMoney":"147.00","repayPlanDetailForApp":{"repayPeriod":"1","repayCapital":"0","repayInterest":"0","cashdepositFee":null,"repayTotal":"147.00","remark":"第1期还款","repayDate":"Mon May 15 00:00:00 CST 2017","gpsCost":"0","parkCost":"0","depreciationFee":"0","drunkDrive":"147"}},{"period":"2","totalMoney":"100.00","repayPlanDetailForApp":{"repayPeriod":"2","repayCapital":"0","repayInterest":"0","cashdepositFee":null,"repayTotal":"100.00","remark":"第2期还款","repayDate":"Thu Jun 15 00:00:00 CST 2017","gpsCost":"0","parkCost":"0.00","depreciationFee":"0","drunkDrive":"100.00"}},{"period":"3","totalMoney":"900.01","repayPlanDetailForApp":{"repayPeriod":"3","repayCapital":"0.01","repayInterest":"0","cashdepositFee":null,"repayTotal":"900.01","remark":"第3期还款","repayDate":"Sat Jul 15 00:00:00 CST 2017","gpsCost":"800.00","parkCost":"0","depreciationFee":"0","drunkDrive":"100"}}]
         */

        private String repayTotal;
        private List<RepayPlanListBean> repayPlanList;

        protected ResultBean(Parcel in) {
            repayTotal = in.readString();
            repayPlanList = in.createTypedArrayList(RepayPlanListBean.CREATOR);
        }

        public static final Creator<ResultBean> CREATOR = new Creator<ResultBean>() {
            @Override
            public ResultBean createFromParcel(Parcel in) {
                return new ResultBean(in);
            }

            @Override
            public ResultBean[] newArray(int size) {
                return new ResultBean[size];
            }
        };

        public String getRepayTotal() {
            return repayTotal;
        }

        public void setRepayTotal(String repayTotal) {
            this.repayTotal = repayTotal;
        }

        public List<RepayPlanListBean> getRepayPlanList() {
            return repayPlanList;
        }

        public void setRepayPlanList(List<RepayPlanListBean> repayPlanList) {
            this.repayPlanList = repayPlanList;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(repayTotal);
            dest.writeTypedList(repayPlanList);
        }

        public static class RepayPlanListBean implements Parcelable{
            /**
             * period : 0
             * totalMoney : 800.00
             * repayPlanDetailForApp : {"repayPeriod":"0","repayCapital":"0","repayInterest":"0","cashdepositFee":null,"repayTotal":"800.00","remark":"第0期还款","repayDate":"Sat Apr 01 00:00:00 CST 2017","gpsCost":"800.00","parkCost":"0","depreciationFee":"0","drunkDrive":"0"}
             */

            private String period;
            private String totalMoney;
            private RepayPlanDetailForAppBean repayPlanDetailForApp;

            protected RepayPlanListBean(Parcel in) {
                period = in.readString();
                totalMoney = in.readString();
                repayPlanDetailForApp = in.readParcelable(RepayPlanDetailForAppBean.class.getClassLoader());
            }

            public static final Creator<RepayPlanListBean> CREATOR = new Creator<RepayPlanListBean>() {
                @Override
                public RepayPlanListBean createFromParcel(Parcel in) {
                    return new RepayPlanListBean(in);
                }

                @Override
                public RepayPlanListBean[] newArray(int size) {
                    return new RepayPlanListBean[size];
                }
            };

            public String getPeriod() {
                return period;
            }

            public void setPeriod(String period) {
                this.period = period;
            }

            public String getTotalMoney() {
                return totalMoney;
            }

            public void setTotalMoney(String totalMoney) {
                this.totalMoney = totalMoney;
            }

            public RepayPlanDetailForAppBean getRepayPlanDetailForApp() {
                return repayPlanDetailForApp;
            }

            public void setRepayPlanDetailForApp(RepayPlanDetailForAppBean repayPlanDetailForApp) {
                this.repayPlanDetailForApp = repayPlanDetailForApp;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(period);
                dest.writeString(totalMoney);
                dest.writeParcelable(repayPlanDetailForApp, flags);
            }

            public static class RepayPlanDetailForAppBean implements Parcelable{
                /**
                 * repayPeriod : 0
                 * repayCapital : 0
                 * repayInterest : 0
                 * cashdepositFee : null
                 * repayTotal : 800.00
                 * remark : 第0期还款
                 * repayDate : Sat Apr 01 00:00:00 CST 2017
                 * gpsCost : 800.00
                 * parkCost : 0
                 * depreciationFee : 0
                 * drunkDrive : 0
                 */

                private String repayPeriod;
                private String repayCapital;
                private String repayInterest;
                private String cashdepositFee;
                private String repayTotal;
                private String remark;
                private String repayDate;
                private String gpsCost;
                private String parkCost;
                private String depreciationFee;
                private String drunkDrive;

                protected RepayPlanDetailForAppBean(Parcel in) {
                    repayPeriod = in.readString();
                    repayCapital = in.readString();
                    repayInterest = in.readString();
                    cashdepositFee = in.readString();
                    repayTotal = in.readString();
                    remark = in.readString();
                    repayDate = in.readString();
                    gpsCost = in.readString();
                    parkCost = in.readString();
                    depreciationFee = in.readString();
                    drunkDrive = in.readString();
                }

                public static final Creator<RepayPlanDetailForAppBean> CREATOR = new Creator<RepayPlanDetailForAppBean>() {
                    @Override
                    public RepayPlanDetailForAppBean createFromParcel(Parcel in) {
                        return new RepayPlanDetailForAppBean(in);
                    }

                    @Override
                    public RepayPlanDetailForAppBean[] newArray(int size) {
                        return new RepayPlanDetailForAppBean[size];
                    }
                };

                public String getRepayPeriod() {
                    return repayPeriod;
                }

                public void setRepayPeriod(String repayPeriod) {
                    this.repayPeriod = repayPeriod;
                }

                public String getRepayCapital() {
                    return repayCapital;
                }

                public void setRepayCapital(String repayCapital) {
                    this.repayCapital = repayCapital;
                }

                public String getRepayInterest() {
                    return repayInterest;
                }

                public void setRepayInterest(String repayInterest) {
                    this.repayInterest = repayInterest;
                }

                public String getCashdepositFee() {
                    return cashdepositFee;
                }

                public void setCashdepositFee(String cashdepositFee) {
                    this.cashdepositFee = cashdepositFee;
                }

                public String getRepayTotal() {
                    return repayTotal;
                }

                public void setRepayTotal(String repayTotal) {
                    this.repayTotal = repayTotal;
                }

                public String getRemark() {
                    return remark;
                }

                public void setRemark(String remark) {
                    this.remark = remark;
                }

                public String getRepayDate() {
                    return repayDate;
                }

                public void setRepayDate(String repayDate) {
                    this.repayDate = repayDate;
                }

                public String getGpsCost() {
                    return gpsCost;
                }

                public void setGpsCost(String gpsCost) {
                    this.gpsCost = gpsCost;
                }

                public String getParkCost() {
                    return parkCost;
                }

                public void setParkCost(String parkCost) {
                    this.parkCost = parkCost;
                }

                public String getDepreciationFee() {
                    return depreciationFee;
                }

                public void setDepreciationFee(String depreciationFee) {
                    this.depreciationFee = depreciationFee;
                }

                public String getDrunkDrive() {
                    return drunkDrive;
                }

                public void setDrunkDrive(String drunkDrive) {
                    this.drunkDrive = drunkDrive;
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel dest, int flags) {
                    dest.writeString(repayPeriod);
                    dest.writeString(repayCapital);
                    dest.writeString(repayInterest);
                    dest.writeString(cashdepositFee);
                    dest.writeString(repayTotal);
                    dest.writeString(remark);
                    dest.writeString(repayDate);
                    dest.writeString(gpsCost);
                    dest.writeString(parkCost);
                    dest.writeString(depreciationFee);
                    dest.writeString(drunkDrive);
                }
            }
        }
    }
}
